package com.mc.web.controller.system;

import com.mc.common.core.controller.BaseController;
import com.mc.common.core.domain.entity.SysRole;
import com.mc.common.core.page.TableDataInfo;
import com.mc.system.domain.SysAppRole;
import com.mc.system.service.ISysAppRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/role/app")
public class SysAppRoleController extends BaseController {

    @Autowired
    private ISysAppRoleService appRoleService;

    @PreAuthorize("@ss.hasPermi('system:role:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysAppRole role)
    {
        startPage();
        List<SysAppRole> list = appRoleService.selectSysAppRoleList(role);
        return getDataTable(list);
    }
}
